package com.tcpudp.model;

import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

@Getter
@Setter
public class Connection {
    private String id;
    private String serverId;
    private String remoteAddress;
    private int remotePort;
    private LocalDateTime connectedTime;
    private boolean active;
    private List<Message> messages;

    public Connection() {
        this.id = UUID.randomUUID().toString();
        this.connectedTime = LocalDateTime.now();
        this.active = true;
        this.messages = new ArrayList<>();
    }
}